From: Jim Porter Date: Wed, 18 Jan 2023 00:59:13 +0000 (-0800) Subject: ; Fix Eshell prompt tests when the current user is root X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~14^2~18^2~6159 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=281f48f19ecad706a639d57cb937afb0b97eded7;p=emacs.git ; Fix Eshell prompt tests when the current user is root * test/lisp/eshell/em-prompt-tests.el (em-prompt-test/field-properties) (em-prompt-test/field-properties/no-highlight): Handle the case when the current user is root. --- diff --git a/test/lisp/eshell/em-prompt-tests.el b/test/lisp/eshell/em-prompt-tests.el index 91464a98c26..db45e2ae3a7 100644 --- a/test/lisp/eshell/em-prompt-tests.el +++ b/test/lisp/eshell/em-prompt-tests.el @@ -44,7 +44,8 @@ (should (equal-including-properties last-prompt (propertize - (format "%s $ " (directory-file-name default-directory)) + (format "%s %s " (directory-file-name default-directory) + (if (= (file-user-uid) 0) "#" "$")) 'read-only t 'field 'prompt 'font-lock-face 'eshell-prompt @@ -68,7 +69,8 @@ This tests the case when `eshell-highlight-prompt' is nil." (should (equal-including-properties last-prompt (propertize - (format "%s $ " (directory-file-name default-directory)) + (format "%s %s " (directory-file-name default-directory) + (if (= (file-user-uid) 0) "#" "$")) 'field 'prompt 'front-sticky '(field) 'rear-nonsticky '(field))))